package com.gxa.finance.controller;

import com.gxa.common.commons.R;
import com.gxa.common.pojo.ServiceDetails;
import com.gxa.finance.service.ServiceDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@RestController
@RequestMapping("/finance/ServiceDetails")
public class ServiceDetailsController {

    @Autowired
    private ServiceDetailsService serviceDetailsService;

    //1、查询接口
    @GetMapping("/findServiceDetailsList")
    public R findServiceDetailsList (String serve,Integer price){

        return serviceDetailsService.findServiceDetailsList(serve,price);
    }

    //2、添加
    @PostMapping("/addServiceDetails")
    public R addServiceDetails (@RequestBody ServiceDetails serviceDetails){

        return serviceDetailsService.addServiceDetails(serviceDetails);
    }

    //3、删除
    @PostMapping("/delServiceDetails")
    public R delServiceDetails (Integer id){

        return serviceDetailsService.delServiceDetails(id);
    }

    //修改
    @PostMapping("/updateServiceDetails")
    public R updateServiceDetails (@RequestBody ServiceDetails serviceDetails){

        return serviceDetailsService.updateServiceDetails(serviceDetails);
    }

}
